package research.observer.telefone;

import java.util.Collection;
import java.util.HashSet;

public class Telefone {
	
	private Collection<TelefoneListenner> listenners = new HashSet<TelefoneListenner>();
	
	public void tocaTelefone() {
		for (TelefoneListenner l : listenners) {
			TelefoneEvent t = new TelefoneEvent(this);
			l.telefoneTocou(t);
		}
	}
	
	public void addListenner(TelefoneListenner l) {
		listenners.add(l);
	}
	
	public void remListenner(TelefoneListenner l) {
		listenners.remove(l);
	}
}
